package com.think.oauth.user.dao.user;

import java.util.ArrayList;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.think.oauth.user.model.Permission;
import com.think.oauth.user.model.RolePermission;

@Mapper
public interface RolePermissionDao extends BaseMapper<RolePermission> {

	@Select("SELECT * FROM think_permission WHERE think_permission.permission_id IN (SELECT think_role_permission.permission_id FROM think_role_permission Where think_role_permission.role_id = #{roleId})")
	ArrayList<Permission> getPermissionsByRoleId(Integer roleId);
}
